package com.itheima.d2_collection_nesting;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Stream;

/*
      目标：理解集合的嵌套。
      江苏省 = "南京市","扬州市","苏州市","无锡市","常州市"
      湖北省 = "武汉市","孝感市","十堰市","宜昌市","鄂州市"
      河北省 = "石家庄市","唐山市", "邢台市", "保定市", "张家口市"
 */
public class Test {
    public static void main(String[] args) {
        HashMap<String, ArrayList<String>> map = new HashMap<>();

        ArrayList<String> js = new ArrayList<String>();
        Collections.addAll(js,"南京市","扬州市","苏州市","无锡市","常州市");

        ArrayList<String>  hb = new ArrayList<String>();
        Collections.addAll(hb,"武汉市","孝感市","十堰市","宜昌市","鄂州市");

        ArrayList<String>  heb = new ArrayList<String>();
        Collections.addAll(heb,"石家庄市","唐山市", "邢台市", "保定市", "张家口市");

        map.put("江苏省",js);
        map.put("湖北省",hb);
        map.put("河北省",heb);

        map.forEach((k,v)->{
            System.out.print(k+":");
            for(String j:v){
                System.out.print(j+" ");
            }
            System.out.println();
        });

    }
}
